package com.sright.bcard.content.dal.dao.impl;

import com.sright.bcard.common.service.share.base.dao.BaseDAOImpl;
import com.sright.bcard.common.service.share.base.dao.BaseMapper;
import com.sright.bcard.common.service.share.dto.page.PageParamRequest;
import com.sright.bcard.content.dal.dao.FeedbackDAO;
import com.sright.bcard.content.dal.entity.FeedbackDO;
import com.sright.bcard.content.dal.mapper.FeedbackDOMapper;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.List;

@Repository
public class FeedbackDAOImpl extends BaseDAOImpl<FeedbackDO> implements FeedbackDAO {

    @Resource
    private FeedbackDOMapper feedbackDOMapper;

    @Override
    protected BaseMapper<FeedbackDO> getObjMapper() {
        return feedbackDOMapper;
    }

    @Override
    public Integer count(Long memberId) {
        return feedbackDOMapper.count(memberId);
    }

    @Override
    public List<FeedbackDO> pageList(Long beginTime, Long endTime, Integer status, PageParamRequest pageParamRequest) {
        return feedbackDOMapper.pageList(beginTime, endTime, status, pageParamRequest);
    }

    @Override
    public boolean updateStatus(Long feedbackId, Integer usefulStatus) {
        return feedbackDOMapper.updateStatus(feedbackId, usefulStatus);
    }
}
